//红外避障

const int HongWeiPin = 2;
bool judge = false;
void setup() {
  Serial.begin(9600);
  attachInterrupt(0,waring,CHANGE);
}

void loop() {
  if (digitalRead(HongWeiPin) == LOW) {
    tone(HongWeiPin,1000);
  } else {
    noTone(HongWeiPin);
  }
  delay(130);
}
